<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        <form action="">
            用户名:<input type='text' v-model='user' @keyup.aaa='kp' />==={{user}} </br>
            密码:<input type='text' v-model='pwd' />==={{pwd}}

            <input type="button" value='登录' @click='btn(123)'>
            <input type="button" value='点我触发登录按钮的事件' @click='btn2'>
            <hr>

            <select name="" id="" v-model="opt">
                <option value="opt">no1</option>
                <option value="2a">no2</option>
                <option value="3a">no3</option>
            </select>
            ==={{opt}}

            <input type="button" value='获取事件对象' @click='ele(1,$event)' @mouseover='user1'>
        </form>
    </div>
    <script type='text/javascript'>
        Vue.config.keyCodes.aaa=65

        var vm = new Vue({
            el: '#app',
            data: {
                opt: '111',
                msg: 'Hello Vue',
                user: 'admin',
                pwd: '123456'
            },
            methods: {
                // btn:function(){
                //     alert(1111)
                // }
                // btn:()=>{
                //     alert(1111)
                // }
                kp(e){
                   console.log(e,12);
                   
                },
                btn(aa) {
                    console.log(aa, 7777);

                    //alert(1111)
                    console.log(this.user, this.pwd);
                },
                btn2() {

                    this.btn();
                },
                ele(a,e) {
                    console.log(a,e.stopPropagation());

                },
                user1(){
                    alert(1111)
                }
            }
        });
    </script>
</body>

</html>